
import { message,notification, Modal } from "ant-design-vue"



message.config({
    duration: 2,
})

notification.config({
  placement: "bottomRight",
  bottom: "50px",
  duration: 3,
})
export const $message = message

export const $notification = notification

/**
 * modal 弹出框
 * @param {*} title
 * @param {*} content
 * @param {*} options
 * @returns
 */
export function $alert (title, content, options){
  return new Promise((resolve)=> {
    Modal.confirm({
      title: title || "提示",
      content,
      maskClosable: false,
      onOk() {
        resolve("ok")
      },
      onCancel() {
        resolve("cancal")
      },
      ...options
    })
  })
}

